<?php
class flow_userClassModel extends flowModel
{
	public function getstatusarr()
	{
		$barr[1] = array('启用','green');
		$barr[0] = array('停用','#888888');
		return $barr;
	}
	
	
	
	/**
	*	用户显示展示
	*/
	protected function flowbillwhere($uid, $lx)
	{
	
		return array(
			'fields'=> '`name`,`id`,`id` as uid,`face`,`sort`,`deptallname`,`ranking`,`tel`,`mobile`,`email`,`user`,num,workdate,sex,deptname,superman,status,type',
			'order' => 'sort'
		);
	}
	
	//替换
	public function flowrsreplace($rs, $lx=0)
	{
		if($this->rock->ismobile()){
			if(isset($rs['mobile']) && !isempt($rs['mobile']))$rs['mobile']='<a href="tel:'.$rs['mobile'].'">'.$rs['mobile'].'</a>';
			if(isset($rs['tel']) && !isempt($rs['tel']))$rs['tel']='<a href="tel:'.$rs['tel'].'">'.$rs['tel'].'</a>';
		}
		$type = arrvalue($rs,'type');
		if($type=='0')$rs['type']='';
		if($type=='1')$rs['type']='<font color=green>是</font>';
		if(isset($rs['companyid']) && $lx==1)$rs['companyid'] = m('company')->getmou('name',"`id`='".$rs['companyid']."'");

		return $rs;
	}
	
	//编辑时候替换
	protected function flowrsreplaceedit($rs)
	{
		$rs['groupname'] = m('sjoin')->getgroupid($rs['id']);
		$rs['pass']		 = '';
		unset($rs['deptallname']);
		return $rs;
	}
}